@echo off
for %%i in (%0) do (set "name=%%~ni") 
echo %name%...  Output to %name%.log
call "%VS100COMNTOOLS%\vsvars32.bat" > %name%.log
msbuild "ddm.sln" /t:Rebuild /p:Configuration=Debug > %name%.log
msbuild "ddm.sln" /t:Rebuild /p:Configuration=Release >> %name%.log

mkdir Output\Inc
mkdir Output\Lib\Debug
mkdir Output\Lib\Release

xcopy CommonFunc\CommonFunc.h Output\Inc /y
xcopy CommonFunc\dlmalloc.h Output\Inc /y
xcopy CommonFunc\list.h Output\Inc /y
xcopy CommonFunc\cJSON.h Output\Inc /y
xcopy CommonFunc\ThreadPool.h Output\Inc /y
xcopy ddm\ddm.h Output\Inc /y
xcopy ddm\otpdb.h Output\Inc /y

xcopy Debug\CommonFunc.dll Output\Lib\Debug /y
xcopy Debug\CommonFunc.lib Output\Lib\Debug /y
xcopy Debug\ddm.dll Output\Lib\Debug /y
xcopy Debug\ddm.lib Output\Lib\Debug /y
xcopy Release\CommonFunc.dll Output\Lib\Release /y
xcopy Release\CommonFunc.lib Output\Lib\Release /y
xcopy Release\ddm.dll Output\Lib\Release /y
xcopy Release\ddm.lib Output\Lib\Release /y

pause